//
//  ST_MusicInfo.m
//  ShiTing
//
//  Created by lanou3g on 15/7/14.
//  Copyright (c) 2015年 liudianliang. All rights reserved.
//

#define kActivityUrl @"http://api.dongting.com/frontpage/frontpage?f=f62&s=s200&v=v8.0.1.2015062518&version=0"


#import "ST_MusicInfo.h"
#import "ST_MusicViewController.h"
#import "ST_MusicModel.h"
#import "ST_MusicModelTwo.h"

@interface ST_MusicInfo()
@property (nonatomic, retain) NSMutableArray *modelArr;


@end
@implementation ST_MusicInfo
+ (instancetype)sharedMusicInfo
{
    static ST_MusicInfo *musicInfo = nil;
    static dispatch_once_t one;
    dispatch_once(&one, ^{
        musicInfo = [[ST_MusicInfo alloc]init];
    });
    return musicInfo;
}

- (void)loadData
{

    
    NSString *str = [[NSBundle mainBundle] pathForResource:@"MusicInfoList" ofType:@"plist"];
//    NSURL *url = [NSURL URLWithString:@"http://ac-dx48y7nv.clouddn.com/q201XjlUU2KafjbFp2zEaUSk6z6Fd930lpDzoFCt.plist"];
    NSArray *arr1 = [NSArray arrayWithContentsOfFile:str];
    self.modelArr = [NSMutableArray array];
    for (NSDictionary *dic in arr1) {
        ST_MusicModel *model = [[ST_MusicModel alloc] init];
        [model setValuesForKeysWithDictionary:dic];
        [self.modelArr addObject:model];
        [model release];
    }
    
    [[NSNotificationCenter defaultCenter] postNotificationName:@"didFinishLoadData" object:[ST_MusicViewController class]];
}

- (ST_MusicModel *)modelForIndex:(NSInteger)index
{
    return self.modelArr[index];
}

- (NSInteger)modelArrCount
{
    return self.modelArr.count;
}

@end
